<%@page import="com.mconnect.msurvey.model.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib prefix="s" uri="/struts-tags"%>
 <%
// w celu poprawnie dzialajacej sesji:
response.setHeader("Cache-Control","no-store"); 
response.setHeader("Pragma","no-cache"); 
response.setDateHeader ("Expires", 0); 
%>     
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
	  <title>Panel Admina</title>
	  <link rel="stylesheet" href="resources/css/ap.css">
	  <link rel="stylesheet" href="js/jQuery/demos.css">
	  <link rel="stylesheet" href="js/jQuery/themes/base/jquery.ui.all.css">
  </head>

<body>
<div id="top">
	<div class="sessionUser">
    	<div id="logoMconnect">
    		<img src="resources/images/top_logo.gif" width="84" height="59" alt="image001"/>
    	</div>
    	<div id="mConnect_txt">
        	mConnect<br/>al. Jana Pawła II 41c<br/>31-864 Kraków
       </div>
    	
      <% User admin = (User) session.getAttribute("admin");
      	
      	 %>
    </div>
    <img src="resources/images/kreska.png" class="kreska">
    <div class="header_txt">
    	<a href="adminPanel.jsp" style="text-decoration: none;">
     		<p class="header_txt_1">mSurvey</p>
      		<p class="header_txt_2">Panel Administratora</p>
      	</a>
    </div>
    <ul id=menu>
      
    <li><s:a action="goToSearchSurvey"> Wyszukaj ankietę </s:a></li>
	<li><s:a action="goToCampaigns">Kampanie</s:a></li>
	<li><s:a action="goToRegisterUser">Dodaj ankietera</s:a></li>
	<li><s:a action="goToConfirmList">Potwierdziły przybycie</s:a></li>
	<li><s:a action="goToReports">Raporty</s:a></li>
	<li style="float: right"><s:a action="logoutAdmin">Wyloguj</s:a></li>
    </ul>
    
    <div id=kategorie>
    <%if(admin == null){  %>
    	<jsp:forward page="loginAdminForm.jsp"></jsp:forward>
      		
      	<%}else{ %>
      		<% String message = request.getParameter("message");
	      		if(message != null){%>
		      		<div style="float: left; width: 90%; margin-left:5%; background-color: #006633; color: white; text-align: center;">
						
							<h1><%= message %></h1>
							
					</div>
				<%} %> 
				<br><br />
			<h1 style="text-align: center">Witaj <%= admin.getFirstname() + " " + admin.getLastname() %></h1>
		<%} %>
    </div>
</div>
  </body>
</html>